package com.nut.lmsc.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nut.lmsc.entity.Member;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.io.Serializable;

@Mapper
public interface MemberMapper extends BaseMapper<Member> {

    IPage<Member> listPage(Page page,
                           @Param("name") String name,
                           @Param("mobile") String mobile,
                           @Param("status") Integer status);

    @Update("update biz_member set mobile=null,deleted=1 where id=#{id}")
    void deleteMember(@Param("id") Serializable id);

    @Select("select * from biz_member where mobile=#{mobile} limit 1")
    Member selectByMobile(@Param("mobile") String mobile);

}
